package com.zerosoft.guotai.dao;

import lombok.Data;

@Data
public class G6EventPackage {
    private short tag;  //$$开头
    private byte length;    //数据长度，基本为0x7d
    private GuotaiEventParse eventParse;
    private byte checkSum;  //校验和

    /**
     * 判断是否为G6y设备事件包，数据以$$开头
     * @return
     */
    public Boolean isG6EventPackage()
    {
        return (char)(this.tag & 0xFF) == '$' && (char)(this.tag >> 8 & 0xFF) == '$';
    }
    public Boolean isEventPackage()
    {
        return this.length == 0x7d;
    }
}
